<template>
  <div class="q-pa-md q-gutter-sm">
    <t-btn label="Alert" color="primary" @click="myFn" />
    <t-btn label="Confirm" color="primary" @click="confirm = true" />
    <t-btn label="Prompt" color="primary" @click="prompt = true" />

    <t-dialog v-model="show">
      <t-card>
        <t-card-section>
          <div class="text-h6">Alert</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>

        <t-card-actions align="right">
          <t-btn flat label="OK" color="primary" v-close-popup />
        </t-card-actions>
      </t-card>
    </t-dialog>

    <q-dialog v-model="confirm" persistent>
      <t-card>
        <t-card-section class="row items-center">
          <t-avatar icon="signal_wifi_off" color="primary" text-color="white" />
          <span class="q-ml-sm"
            >You are currently not connected to any network.</span
          >
        </t-card-section>

        <t-card-actions align="right">
          <t-btn flat label="Cancel" color="primary" v-close-popup />
          <t-btn flat label="Turn on Wifi" color="primary" v-close-popup />
        </t-card-actions>
      </t-card>
    </q-dialog>

    <t-dialog v-model="prompt" persistent>
      <t-card style="min-width: 350px">
        <t-card-section>
          <div class="text-h6">Your address</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          <t-input
            dense
            v-model="address"
            autofocus
            @keyup.enter="prompt = false"
          />
        </t-card-section>

        <t-card-actions align="right" class="text-primary">
          <t-btn flat label="Cancel" v-close-popup />
          <t-btn flat label="Add address" v-close-popup />
        </t-card-actions>
      </t-card>
    </t-dialog>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      const alert = ref(false);
      const show = ref(false)
      function myFn() {
        show.value = true;
        // debugger
        console.log(show.value,'dwadawd')
      }
      return {
        alert,
        confirm: ref(false),
        prompt: ref(false),
        address: ref(''),
        show,
        myFn,
      };
    },
  };
</script>
